<template>
  <div>
    <el-table v-loading="tableLoading" ref="table" :data="list" style="width: 100%" :border="true">
      <el-table-column v-for="(v,index) in columns" :type="v.type" :label="v.title" :prop="v.key" :width="v.width"
        :key="index">
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  name: 'approveLog',
  props: {
    api: { type: String, default: () => '' },
    form: { type: Object, default: () => {} },
  },
  data() {
    return {
      list: [],
      tableLoading: false,
      columns: [
        { title: '序号', key: '', width: 110, type: 'index' },
        { title: '关卡', key: 'workflow_item_name', width: 180 },
        { title: '操作', key: 'operation_name', width: 180 },
        { title: '操作内容', key: 'content', width: 140 },
        { title: '操作人', key: 'create_user' },
        { title: '操作时间', key: 'create_time' },
      ],
    }
  },
  mounted() {
    this.getList()
  },
  methods: {
    getList() {
      this.tableLoading = true
      this.$request(this.api, { id: this.form.id, formName: this.form.form_name })
        .then((r) => {
          this.list = r
        })
        .finally(() => {
          this.tableLoading = false
        })
    },
  },
}
</script>

<style lang="scss" scoped>
</style>
